﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
                    xmlns:helpers="clr-namespace:Notes.Controls.Helpers"
                    xmlns:behaviors="clr-namespace:Notes.Controls.Behaviors"
                    xmlns:converters="clr-namespace:Notes.Controls.Converters"
                    xmlns:system="clr-namespace:System;assembly=mscorlib">
    
    <!--#region Palette-->

    <!--#region Colors-->

    <Color x:Key="PrimaryColor1">#FFF</Color>
    <Color x:Key="PrimaryColor2">#D9D9D9</Color>
    <Color x:Key="PrimaryColor3">#737373</Color>
    <Color x:Key="PrimaryColor4">#383838</Color>
    <Color x:Key="ForegroundPrimaryColor">#383838</Color>

    <Color x:Key="SecondaryColor1">#E9E9E9</Color>
    <Color x:Key="ForegroundSecondaryColor">#000</Color>

    <Color x:Key="AccentColor">#486ED9</Color>
    <Color x:Key="ForegroundAccentColor">#FFF</Color>

    <Color x:Key="ErrorColor">#F25F5A</Color>
    <Color x:Key="ForegroundErrorColor">#FFF</Color>
    <Color x:Key="WarningColor">#FFD16E</Color>
    <Color x:Key="ForegroundWarningColor">#FFF</Color>
    <Color x:Key="InformationColor">#9AB5FF</Color>
    <Color x:Key="ForegroundInformationColor">#FFF</Color>

    <!--<Color x:Key="PrimaryColor1">#FF252526</Color>
    <Color x:Key="PrimaryColor2">#FF3E3E40</Color>
    <Color x:Key="PrimaryColor3">#FF656565</Color>
    <Color x:Key="PrimaryColor4">#FF656565</Color>
    <Color x:Key="ForegroundPrimaryColor">#FFF1F1F1</Color>

    <Color x:Key="SecondaryColor1">#D9D9D9</Color>
    <Color x:Key="ForegroundSecondaryColor">#000</Color>

    <Color x:Key="AccentColor">#FF007ACC</Color>
    <Color x:Key="ForegroundAccentColor">#FFF1F1F1</Color>

    <Color x:Key="ErrorColor">#F25F5A</Color>
    <Color x:Key="ForegroundErrorColor">#FFF</Color>-->

    <!--#endregion Colors-->

    <!--#region Brashes-->

    <SolidColorBrush x:Key="PrimarySolidBrush1" Color="{DynamicResource PrimaryColor1}"/>
    <SolidColorBrush x:Key="PrimarySolidBrush2" Color="{DynamicResource PrimaryColor2}"/>
    <SolidColorBrush x:Key="PrimarySolidBrush3" Color="{DynamicResource PrimaryColor3}"/>
    <SolidColorBrush x:Key="PrimarySolidBrush4" Color="{DynamicResource PrimaryColor4}"/>
    <SolidColorBrush x:Key="ForegroundPrimarySolidBrush" Color="{DynamicResource ForegroundPrimaryColor}"/>

    <SolidColorBrush x:Key="SecondarySolidBrush1" Color="{DynamicResource SecondaryColor1}"/>
    <SolidColorBrush x:Key="ForegroundSecondarySolidBrush" Color="{DynamicResource ForegroundSecondaryColor}"/>

    <SolidColorBrush x:Key="AccentSolidBrush" Color="{DynamicResource AccentColor}"/>
    <SolidColorBrush x:Key="ForegroundAccentSolidBrush" Color="{DynamicResource ForegroundAccentColor}"/>

    <SolidColorBrush x:Key="ErrorSolidBrush" Color="{DynamicResource ErrorColor}"/>
    <SolidColorBrush x:Key="ForegroundErrorSolidBrush" Color="{DynamicResource ForegroundErrorColor}"/>
    <SolidColorBrush x:Key="WarningSolidBrush" Color="{DynamicResource WarningColor}"/>
    <SolidColorBrush x:Key="ForegroundWarningSolidBrush" Color="{DynamicResource ForegroundWarningColor}"/>
    <SolidColorBrush x:Key="InformationSolidBrush" Color="{DynamicResource InformationColor}"/>
    <SolidColorBrush x:Key="ForegroundInformationSolidBrush" Color="{DynamicResource ForegroundInformationColor}"/>

    <!--#endregion Brashes-->

    <!--#endregion Palette-->

    <!--#region Font-->

    <system:Double x:Key="LargeFontSize">16</system:Double>
    <system:Double x:Key="MediumFontSize">14</system:Double>
    <system:Double x:Key="SmallFontSize">10</system:Double>
    
    <FontFamily x:Key="DefaultFont">./Fonts/#Cascadia Mono</FontFamily>
    <FontFamily x:Key="Icons">./Fonts/#icomoon</FontFamily>

    <!--#endregion Variables-->

    <CornerRadius x:Key="LargeRadius">9</CornerRadius>
    <CornerRadius x:Key="MediumRadius">7</CornerRadius>
    <CornerRadius x:Key="SmallRadius">5</CornerRadius>

    <system:Double x:Key="DefaultHeight">23</system:Double>

    <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="Visibility" Value="Hidden"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Name="Border" Margin="1" CornerRadius="2"
                            Background="Transparent"
                            BorderBrush="Transparent"
                            BorderThickness="1">
                        <Path HorizontalAlignment="Center" VerticalAlignment="Center"
                              Fill="{StaticResource ForegroundPrimarySolidBrush}"
                              Data="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush3}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource PrimarySolidBrush1}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="Visibility" Value="Hidden"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Black" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
        <Setter Property="Background" Value="{StaticResource PrimarySolidBrush2}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border CornerRadius="4"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="0"
                            Width="{TemplateBinding Width}"
                            Height="{TemplateBinding Height}"/>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDragging" Value="true">
                            <Setter Property="Background" Value="{StaticResource PrimarySolidBrush3}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition MaxHeight="0"/>
                <RowDefinition Height="0.00001*"/>
                <RowDefinition MaxHeight="0"/>
            </Grid.RowDefinitions>
            <Border Grid.RowSpan="3" CornerRadius="2" Background="Transparent" />
            <RepeatButton Grid.Row="0" Style="{StaticResource ScrollBarLineButton}" Background="Transparent"
                          Height="18" Command="ScrollBar.LineUpCommand" Content="M 0 4 L 8 4 L 4 0 Z" />
            <Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="true">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource ScrollBarThumb}" Margin="3" Width="8"/>
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton Grid.Row="3" Style="{StaticResource ScrollBarLineButton}" Background="Transparent"
                          Height="18" Command="ScrollBar.LineDownCommand" Content="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="0"/>
                <ColumnDefinition Width="0.00001*"/>
                <ColumnDefinition MaxWidth="0"/>
            </Grid.ColumnDefinitions>
            <Border Grid.ColumnSpan="3" CornerRadius="2" Background="Transparent"/>
            <RepeatButton Grid.Column="0"  Style="{StaticResource ScrollBarLineButton}" Background="Transparent"
                          Width="18" Command="ScrollBar.LineLeftCommand" Content="M 4 0 L 4 8 L 0 4 Z" />
            <Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}"
                                  Command="ScrollBar.PageLeftCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource ScrollBarThumb}" Margin="3" Height="8"/>
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageRightCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton Grid.Column="3" Style="{StaticResource ScrollBarLineButton}" Background="Transparent"
                          Width="18" Command="ScrollBar.LineRightCommand" Content="M 0 0 L 4 4 L 0 8 Z"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="18" />
                <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="18"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="DefaultScrollViewer" TargetType="{x:Type ScrollViewer}">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ScrollContentPresenter/>
                        <ScrollBar Name="PART_VerticalScrollBar" Grid.Column="1"
                                   Value="{TemplateBinding VerticalOffset}"
                                   Maximum="{TemplateBinding ScrollableHeight}"
                                   ViewportSize="{TemplateBinding ViewportHeight}"
                                   Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                        <ScrollBar Name="PART_HorizontalScrollBar" Orientation="Horizontal" Grid.Row="1"
                                   Value="{TemplateBinding HorizontalOffset}"
                                   Maximum="{TemplateBinding ScrollableWidth}"
                                   ViewportSize="{TemplateBinding ViewportWidth}"
                                   Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DefaultButton" TargetType="{x:Type Button}">
        <Setter Property="Height" Value="{StaticResource DefaultHeight}"/>
        <Setter Property="FontSize" Value="{StaticResource MediumFontSize}"/>
        <Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundPrimarySolidBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border TextBlock.Foreground="{StaticResource ForegroundPrimarySolidBrush}"
                            x:Name="Border"
                            CornerRadius="{StaticResource MediumRadius}"
                            BorderThickness="1"
                            Background="{StaticResource PrimarySolidBrush1}"
                            BorderBrush="{StaticResource SecondarySolidBrush1}">
                        <ContentPresenter Margin="2"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDefault" Value="true">
                            <Setter TargetName="Border" Property="Border.BorderBrush" Value="{StaticResource AccentSolidBrush}"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter TargetName="Border" Property="Border.BorderBrush" Value="{StaticResource AccentSolidBrush}"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Border.BorderBrush" Value="{StaticResource SecondarySolidBrush}"/>
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource SecondarySolidBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Border.BorderBrush" Value="{StaticResource AccentSolidBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Border.BorderBrush" Value="{StaticResource SecondarySolidBrush}"/>
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource SecondarySolidBrush}"/>
                            <Setter TargetName="Border" Property="TextBlock.Foreground" Value="{StaticResource AccentSolidBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TransparentButton" TargetType="{x:Type Button}">
        <Setter Property="Height" Value="{StaticResource DefaultHeight}"/>
        <Setter Property="FontSize" Value="{StaticResource MediumFontSize}"/>
        <Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundPrimarySolidBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Margin" Value="3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="OuterGrid">
                        <Grid x:Name="ContentGrid">
                            <Border x:Name="Border"
                                    CornerRadius="{StaticResource MediumRadius}"
                                    Background="{TemplateBinding Background}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    Padding="{TemplateBinding Padding}">
                                <Grid x:Name="InnerGrid" Margin="2">
                                    <ContentPresenter HorizontalAlignment="Center"
                                                      VerticalAlignment="Center"
                                                      RecognizesAccessKey="True"/>
                                </Grid>
                            </Border>
                            <Border x:Name="FocusBorder" Visibility="Hidden"
                                    CornerRadius="{StaticResource MediumRadius}"
                                    BorderThickness="1"
                                    BorderBrush="{StaticResource AccentSolidBrush}"/>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter TargetName="FocusBorder" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource AccentSolidBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource ForegroundAccentSolidBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="IconButton" TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultButton}">
        <Setter Property="Width" Value="{StaticResource DefaultHeight}"/>
        <Setter Property="FontFamily" Value="{StaticResource Icons}"/>
    </Style>
    <Style x:Key="TransparentIconButton" TargetType="{x:Type Button}" BasedOn="{StaticResource TransparentButton}">
        <Setter Property="Width" Value="{StaticResource DefaultHeight}"/>
        <Setter Property="FontFamily" Value="{StaticResource Icons}"/>
    </Style>

    <Style x:Key="DefaultTextBlock" TargetType="{x:Type TextBlock}">
        <Setter Property="FontSize" Value="{StaticResource MediumFontSize}"/>
        <Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundPrimarySolidBrush}"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="TextTrimming" Value="CharacterEllipsis" />
        <Setter Property="Margin" Value="3" />
    </Style>

    <Style x:Key="ClearTextButton" TargetType="{x:Type Button}">
        <Setter Property="Height" Value="Auto"/>
        <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Mode=Self}, Path=ActualHeight}"/>
        <Setter Property="FontSize" Value="{StaticResource SmallFontSize}"/>
        <Setter Property="FontFamily" Value="{StaticResource Icons}" />
        <Setter Property="Content" Value="&#x23;" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundPrimarySolidBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="OuterGrid">
                        <Grid x:Name="ContentGrid">
                            <Border x:Name="Border" Padding="{TemplateBinding Padding}"
                                    CornerRadius="{StaticResource SmallRadius}"
                                    Background="{TemplateBinding Background}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="{TemplateBinding BorderBrush}">
                                <Grid x:Name="InnerGrid" Margin="2">
                                    <ContentPresenter HorizontalAlignment="Center"
                                                      VerticalAlignment="Center"
                                                      RecognizesAccessKey="True"/>
                                </Grid>
                            </Border>
                            <Border x:Name="FocusBorder" Visibility="Hidden"
                                    CornerRadius="{StaticResource MediumRadius}"
                                    BorderThickness="1"
                                    BorderBrush="{StaticResource AccentSolidBrush}"/>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource AccentSolidBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource ForegroundAccentSolidBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DefaultCheckBox" TargetType="{x:Type CheckBox}">
        <Setter Property="Height" Value="{StaticResource DefaultHeight}"/>
        <Setter Property="FontSize" Value="{StaticResource MediumFontSize}"/>
        <Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundPrimarySolidBrush}"/>
        <Setter Property="Background" Value="{StaticResource PrimarySolidBrush1}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="{StaticResource PrimarySolidBrush4}"/>
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Margin" Value="3"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Border x:Name="Border"
                            CornerRadius="{StaticResource MediumRadius}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}">
                        <ContentPresenter Margin="2"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush3}"/>
                            <Setter Property="Foreground" Value="{StaticResource ForegroundAccentSolidBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="IconCheckBox" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource DefaultCheckBox}">
        <Setter Property="Width" Value="{StaticResource DefaultHeight}"/>
        <Setter Property="FontFamily" Value="{StaticResource Icons}"/>
    </Style>
    <Style x:Key="FavoriteIconCheckBox" TargetType="{x:Type CheckBox}">
        <Setter Property="Content" Value="&#x22;"/>
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="Height" Value="Auto"/>
        <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Mode=Self}, Path=ActualHeight}"/>
        <Setter Property="FontSize" Value="{StaticResource MediumFontSize}"/>
        <Setter Property="FontFamily" Value="{StaticResource Icons}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="{StaticResource PrimarySolidBrush4}"/>
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Border x:Name="Border"
                            CornerRadius="{StaticResource SmallRadius}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}">
                        <ContentPresenter Margin="2"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush1}"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="true">
                            <!--<Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush2}"/>-->
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsMouseOver}" Value="True">
                <Setter Property="Visibility" Value="Visible" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="DefaultListBox" TargetType="{x:Type ListBox}">
        <Setter Property="FontSize" Value="{DynamicResource MediumFontSize}"/>
        <Setter Property="FontFamily" Value="{DynamicResource DefaultFont}"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundPrimarySolidBrush}"/>
        <Setter Property="Background" Value="{StaticResource PrimarySolidBrush1}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource PrimarySolidBrush4}"/>
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="FontSize" Value="{DynamicResource MediumFontSize}"/>
                    <Setter Property="FontFamily" Value="{DynamicResource DefaultFont}"/>
                    <Setter Property="Foreground" Value="{DynamicResource ForegroundPrimarySolidBrush}"/>
                    <Setter Property="SnapsToDevicePixels" Value="true" />
                    <Setter Property="OverridesDefaultStyle" Value="true" />
                    <Setter Property="Width" Value="{Binding Path=ViewportWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ScrollViewer}}" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                <Border x:Name="Border" SnapsToDevicePixels="true" Padding="3"
                                        BorderThickness="0"
                                        BorderBrush="Transparent"
                                        Background="Transparent"
                                        CornerRadius="{StaticResource SmallRadius}">
                                    <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Border>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush2}"/>
                                    </Trigger>
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush3}"/>
                                        <Setter TargetName="Border" Property="TextBlock.Foreground" Value="{StaticResource ForegroundAccentSolidBrush}"/>
                                    </Trigger>
                                    <!--<Trigger Property="IsKeyboardFocused" Value="True">
                                        <Setter TargetName="Border" Property="Border.BorderBrush" Value="{StaticResource AccentSolidBrush}"/>
                                    </Trigger>-->
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">
                    <Grid>
                        <Border Name="Border" BorderThickness="1"
                                CornerRadius="{StaticResource MediumRadius}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}">
                            <ScrollViewer x:Name="ContentHost" Style="{StaticResource DefaultScrollViewer}">
                                <ItemsPresenter/>
                            </ScrollViewer>
                        </Border>
                        <Border x:Name="FocusBorder" Visibility="Hidden"
                                    CornerRadius="{StaticResource MediumRadius}"
                                    BorderThickness="0 0 0 3"
                                    BorderBrush="{StaticResource PrimarySolidBrush3}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!--<Trigger Property="IsKeyboardFocusWithin" Value="True">
                            <Setter TargetName="Border" Property="Border.BorderBrush" Value="{StaticResource AccentSolidBrush}"/>
                        </Trigger>-->
                        <Trigger Property="IsKeyboardFocusWithin" Value="True">
                            <Setter TargetName="FocusBorder" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="FocusBorder" Property="Border.BorderBrush" Value="{StaticResource AccentSolidBrush}"/>
                            <Setter TargetName="ContentHost" Property="Margin" Value="0 0 0 2"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="FocusBorder" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="ContentHost" Property="Margin" Value="0 0 0 2"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type ToolTip}" TargetType="ToolTip">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Padding" Value="4 3 4 2" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundPrimarySolidBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource DefaultFont}" />
        <Setter Property="FontSize" Value="{StaticResource MediumFontSize}" />
        <Setter Property="Background" Value="{StaticResource PrimarySolidBrush1}"/>
        <Setter Property="BorderBrush" Value="{StaticResource PrimarySolidBrush4}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToolTip">
                    <Border Name="Border"
                            CornerRadius="{StaticResource SmallRadius}"
                            Width="{TemplateBinding Width}"
                            Height="{TemplateBinding Height}"
                            Background="{TemplateBinding Background}"
                            BorderThickness="1"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Padding="{TemplateBinding Padding}">
                        <ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Top" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type ContextMenu}" TargetType="{x:Type ContextMenu}">
        <Setter Property="Padding" Value="4 3 4 2" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundPrimarySolidBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource DefaultFont}" />
        <Setter Property="FontSize" Value="{StaticResource MediumFontSize}" />
        <Setter Property="Background" Value="{StaticResource PrimarySolidBrush1}"/>
        <Setter Property="BorderBrush" Value="{StaticResource PrimarySolidBrush4}"/>
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Grid.IsSharedSizeScope" Value="true" />
        <Setter Property="HasDropShadow" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContextMenu}">
                    <Border x:Name="Border"
                            CornerRadius="{StaticResource SmallRadius}"
                            Width="{TemplateBinding Width}"
                            Height="{TemplateBinding Height}"
                            Background="{TemplateBinding Background}"
                            BorderThickness="1"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Padding="{TemplateBinding Padding}">
                        <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasDropShadow" Value="true">
                            <Setter TargetName="Border" Property="Padding" Value="0,3,0,3" />
                            <Setter TargetName="Border" Property="CornerRadius" Value="4" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="ComboBoxToggleButton"
                 TargetType="{x:Type ToggleButton}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="20" />
            </Grid.ColumnDefinitions>
            <Border x:Name="Border" Background="{StaticResource PrimarySolidBrush1}"
                    Grid.ColumnSpan="2"
                    CornerRadius="{StaticResource MediumRadius}"
                    BorderThickness="0">
            </Border>
            <Border Grid.Column="0" Background="{StaticResource PrimarySolidBrush1}"
                    CornerRadius="{StaticResource MediumRadius}"
                    Margin="1" >
            </Border>
            <Path x:Name="Arrow"
                  Grid.Column="1"
                  HorizontalAlignment="Center"
                  VerticalAlignment="Center"
                  Data="M 0 0 L 4 4 L 8 0 Z"
                  Fill="{StaticResource PrimarySolidBrush4}">
            </Path>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="ComboBoxTextBox"
                 TargetType="{x:Type TextBox}">
        <Border x:Name="PART_ContentHost"
          Focusable="False"
          Background="{TemplateBinding Background}" />
    </ControlTemplate>
    <Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}">
        <Setter Property="Height" Value="{StaticResource DefaultHeight}" />
        <Setter Property="Background" Value="{StaticResource PrimarySolidBrush1}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="{StaticResource PrimarySolidBrush4}" />
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
        <Setter Property="MinWidth" Value="120" />
        <Setter Property="MinHeight" Value="20" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBox}">
                    <Grid>
                        <Border x:Name="OuterBorder"
                            CornerRadius="{StaticResource MediumRadius}"
                            Background="{TemplateBinding Background}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}">
                            <Grid>
                                <ToggleButton x:Name="ToggleButton"
                        Template="{StaticResource ComboBoxToggleButton}"
                        Grid.Column="2"
                        Focusable="false"
                        ClickMode="Press"
                        IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                <ContentPresenter x:Name="ContentSite"
                            IsHitTestVisible="False"
                            Content="{TemplateBinding SelectionBoxItem}"
                            ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                            Margin="3 2 23 4"
                            VerticalAlignment="Stretch"
                            HorizontalAlignment="Left">
                                </ContentPresenter>
                                <TextBox x:Name="PART_EditableTextBox"
                                 Style="{x:Null}"
                                 Template="{StaticResource ComboBoxTextBox}"
                                 HorizontalAlignment="Left"
                                 VerticalAlignment="Bottom"
                                 Margin="3,3,23,3"
                                 Focusable="True"
                                 Background="Transparent"
                                 Visibility="Hidden"
                                 IsReadOnly="{TemplateBinding IsReadOnly}" />
                                <Popup x:Name="Popup"
                               Placement="Bottom"
                               IsOpen="{TemplateBinding IsDropDownOpen}"
                               AllowsTransparency="True"
                               Focusable="False"
                               PopupAnimation="Slide">
                                    <Grid x:Name="DropDown"
                                  SnapsToDevicePixels="True"
                                  MinWidth="{TemplateBinding ActualWidth}"
                                  MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                        <Border x:Name="DropDownBorder"
                                                Background="{TemplateBinding Background}"
                                                CornerRadius="{StaticResource MediumRadius}"
                                                BorderBrush="{StaticResource PrimarySolidBrush4}"
                                                BorderThickness="1">
                                        </Border>
                                        <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
                                            <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                        </ScrollViewer>
                                    </Grid>
                                </Popup>
                            </Grid>
                        </Border>

                        <Border x:Name="FocusBorder" Visibility="Hidden"
                                    CornerRadius="{StaticResource MediumRadius}"
                                    BorderThickness="0 0 0 3"
                                    BorderBrush="{StaticResource PrimarySolidBrush3}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
                        </Trigger>
                        <Trigger SourceName="Popup" Property="AllowsTransparency" Value="true">
                            <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4" />
                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0" />
                        </Trigger>

                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="FocusBorder" Property="Visibility" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
        <Setter Property="FontSize" Value="{DynamicResource MediumFontSize}"/>
        <Setter Property="FontFamily" Value="{DynamicResource DefaultFont}"/>
        <Setter Property="Foreground" Value="{DynamicResource ForegroundPrimarySolidBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <!--<Setter Property="Width" Value="{Binding Path=ViewportWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ScrollViewer}}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Border x:Name="Border" SnapsToDevicePixels="true" Padding="3"
                            BorderThickness="0"
                            BorderBrush="Transparent"
                            Background="Transparent"
                            CornerRadius="{StaticResource SmallRadius}">
                        <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush3}"/>
                            <Setter TargetName="Border" Property="TextBlock.Foreground" Value="{StaticResource ForegroundAccentSolidBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}">
        <Setter Property="Height" Value="21"/>
        <Setter Property="FontSize" Value="{StaticResource MediumFontSize}"/>
        <Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundPrimarySolidBrush}"/>
        <Setter Property="Background" Value="{StaticResource PrimarySolidBrush1}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="{StaticResource PrimarySolidBrush4}"/>
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Padding" Value="5 0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <Border x:Name="Border"
                            CornerRadius="{StaticResource SmallRadius}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Padding="{TemplateBinding Padding}">
                        <ContentPresenter Margin="0 1 0 -1"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter TargetName="Border" Property="Border.Background" Value="{StaticResource PrimarySolidBrush3}"/>
                            <Setter Property="Foreground" Value="{StaticResource ForegroundAccentSolidBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource PrimarySolidBrush2}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>